﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiEdgeStyle : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiEdgeStyle(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiEdgeStyle_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiEdgeStyle obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiEdgeStyle()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiEdgeStyle(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiEdgeStyle cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiEdgeStyle_cast(OdRxObject.getCPtr(pObj));
			OdGiEdgeStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiEdgeStyle_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiEdgeStyle_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiEdgeStyle_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGiEdgeStyle createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiEdgeStyle_createObject();
			OdGiEdgeStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void set(OdGiEdgeStyle style)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_set(this.swigCPtr, OdGiEdgeStyle.getCPtr(style));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiEdgeStyle Assign(OdGiEdgeStyle style)
		{
			OdGiEdgeStyle result = (OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiEdgeStyle_Assign(this.swigCPtr, OdGiEdgeStyle.getCPtr(style)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGiEdgeStyle style)
		{
			bool result = GlobalsPINVOKE.OdGiEdgeStyle_IsEqual(this.swigCPtr, OdGiEdgeStyle.getCPtr(style));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setEdgeModel(OdGiEdgeStyle.EdgeModel model)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setEdgeModel(this.swigCPtr, (int)model);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiEdgeStyle.EdgeModel edgeModel()
		{
			OdGiEdgeStyle.EdgeModel result = (OdGiEdgeStyle.EdgeModel)GlobalsPINVOKE.OdGiEdgeStyle_edgeModel(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setEdgeStyles(uint nStyles)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setEdgeStyles(this.swigCPtr, nStyles);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setEdgeStyleFlag(OdGiEdgeStyle.EdgeStyle flag, bool bEnable)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setEdgeStyleFlag(this.swigCPtr, (int)flag, bEnable);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual uint edgeStyles()
		{
			uint result = GlobalsPINVOKE.OdGiEdgeStyle_edgeStyles(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isEdgeStyleFlagSet(OdGiEdgeStyle.EdgeStyle flag)
		{
			bool result = GlobalsPINVOKE.OdGiEdgeStyle_isEdgeStyleFlagSet(this.swigCPtr, (int)flag);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setIntersectionColor(OdCmColorBase color)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setIntersectionColor(this.swigCPtr, OdCmColorBase.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdCmColorBase intersectionColor()
		{
			OdCmColorBase result = new OdCmColorBase(GlobalsPINVOKE.OdGiEdgeStyle_intersectionColor__SWIG_0(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setObscuredColor(OdCmColorBase color)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setObscuredColor(this.swigCPtr, OdCmColorBase.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdCmColorBase obscuredColor()
		{
			OdCmColorBase result = new OdCmColorBase(GlobalsPINVOKE.OdGiEdgeStyle_obscuredColor__SWIG_0(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setObscuredLinetype(OdGiEdgeStyle.LineType ltype)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setObscuredLinetype(this.swigCPtr, (int)ltype);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiEdgeStyle.LineType obscuredLinetype()
		{
			OdGiEdgeStyle.LineType result = (OdGiEdgeStyle.LineType)GlobalsPINVOKE.OdGiEdgeStyle_obscuredLinetype(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setIntersectionLinetype(OdGiEdgeStyle.LineType ltype)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setIntersectionLinetype(this.swigCPtr, (int)ltype);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiEdgeStyle.LineType intersectionLinetype()
		{
			OdGiEdgeStyle.LineType result = (OdGiEdgeStyle.LineType)GlobalsPINVOKE.OdGiEdgeStyle_intersectionLinetype(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setCreaseAngle(double nAngle)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setCreaseAngle(this.swigCPtr, nAngle);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double creaseAngle()
		{
			double result = GlobalsPINVOKE.OdGiEdgeStyle_creaseAngle(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setEdgeModifiers(uint nModifiers)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setEdgeModifiers(this.swigCPtr, nModifiers);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setEdgeModifierFlag(OdGiEdgeStyle.EdgeModifier flag, bool bEnable)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setEdgeModifierFlag(this.swigCPtr, (int)flag, bEnable);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual uint edgeModifiers()
		{
			uint result = GlobalsPINVOKE.OdGiEdgeStyle_edgeModifiers(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isEdgeModifierFlagSet(OdGiEdgeStyle.EdgeModifier flag)
		{
			bool result = GlobalsPINVOKE.OdGiEdgeStyle_isEdgeModifierFlagSet(this.swigCPtr, (int)flag);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setEdgeColor(OdCmColorBase color, bool bEnableModifier)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setEdgeColor(this.swigCPtr, OdCmColorBase.getCPtr(color), bEnableModifier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdCmColorBase edgeColor()
		{
			OdCmColorBase result = new OdCmColorBase(GlobalsPINVOKE.OdGiEdgeStyle_edgeColor__SWIG_0(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setOpacityLevel(double nLevel, bool bEnableModifier)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setOpacityLevel(this.swigCPtr, nLevel, bEnableModifier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double opacityLevel()
		{
			double result = GlobalsPINVOKE.OdGiEdgeStyle_opacityLevel(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setEdgeWidth(int nWidth, bool bEnableModifier)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setEdgeWidth(this.swigCPtr, nWidth, bEnableModifier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual int edgeWidth()
		{
			int result = GlobalsPINVOKE.OdGiEdgeStyle_edgeWidth(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setOverhangAmount(int nAmount, bool bEnableModifier)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setOverhangAmount(this.swigCPtr, nAmount, bEnableModifier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual int overhangAmount()
		{
			int result = GlobalsPINVOKE.OdGiEdgeStyle_overhangAmount(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setJitterAmount(OdGiEdgeStyle.JitterAmount amount, bool bEnableModifier)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setJitterAmount(this.swigCPtr, (int)amount, bEnableModifier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiEdgeStyle.JitterAmount jitterAmount()
		{
			OdGiEdgeStyle.JitterAmount result = (OdGiEdgeStyle.JitterAmount)GlobalsPINVOKE.OdGiEdgeStyle_jitterAmount(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setWiggleAmount(OdGiEdgeStyle.WiggleAmount amount, bool bEnableModifier)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setWiggleAmount(this.swigCPtr, (int)amount, bEnableModifier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiEdgeStyle.WiggleAmount wiggleAmount()
		{
			OdGiEdgeStyle.WiggleAmount result = (OdGiEdgeStyle.WiggleAmount)GlobalsPINVOKE.OdGiEdgeStyle_wiggleAmount(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSilhouetteColor(OdCmColorBase color)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setSilhouetteColor(this.swigCPtr, OdCmColorBase.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdCmColorBase silhouetteColor()
		{
			OdCmColorBase result = new OdCmColorBase(GlobalsPINVOKE.OdGiEdgeStyle_silhouetteColor__SWIG_0(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSilhouetteWidth(short nWidth)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setSilhouetteWidth(this.swigCPtr, nWidth);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual short silhouetteWidth()
		{
			short result = GlobalsPINVOKE.OdGiEdgeStyle_silhouetteWidth(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setHaloGap(int nHaloGap, bool bEnableModifier)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setHaloGap(this.swigCPtr, nHaloGap, bEnableModifier);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual int haloGap()
		{
			int result = GlobalsPINVOKE.OdGiEdgeStyle_haloGap(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setIsolines(ushort nIsolines)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setIsolines(this.swigCPtr, nIsolines);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual ushort isolines()
		{
			ushort result = GlobalsPINVOKE.OdGiEdgeStyle_isolines(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setHidePrecision(bool bHidePrecision)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setHidePrecision(this.swigCPtr, bHidePrecision);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool hidePrecision()
		{
			bool result = GlobalsPINVOKE.OdGiEdgeStyle_hidePrecision(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setEdgeStyleApply(OdGiEdgeStyle.EdgeStyleApply apply)
		{
			GlobalsPINVOKE.OdGiEdgeStyle_setEdgeStyleApply(this.swigCPtr, (int)apply);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGiEdgeStyle.EdgeStyleApply edgeStyleApply()
		{
			OdGiEdgeStyle.EdgeStyleApply result = (OdGiEdgeStyle.EdgeStyleApply)GlobalsPINVOKE.OdGiEdgeStyle_edgeStyleApply(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum EdgeModel
		{
			kNoEdges,
			kIsolines,
			kFacetEdges
		}

		public enum EdgeStyle
		{
			kNoEdgeStyle,
			kVisible,
			kSilhouette,
			kObscured = 4,
			kIntersection = 8
		}

		[Flags]
		public enum EdgeModifier
		{
			kNoEdgeModifiers = 0,
			kOverhang = 1,
			kJitter = 2,
			kWidth = 4,
			kColor = 8,
			kHaloGap = 16,
			kLinetype = 32,
			kAlwaysOnTop = 64,
			kOpacity = 128,
			kWiggle = 256,
			kTexture = 512
		}

		public enum JitterAmount
		{
			kJitterLow = 1,
			kJitterMedium,
			kJitterHigh
		}

		public enum WiggleAmount
		{
			kWiggleLow = 1,
			kWiggleMedium,
			kWiggleHigh
		}

		public enum LineType
		{
			kSolid = 1,
			kDashed,
			kDotted,
			kShortDash,
			kMediumDash,
			kLongDash,
			kDoubleShortDash,
			kDoubleMediumDash,
			kDoubleLongDash,
			kMediumLongDash,
			kSparseDot
		}

		public enum EdgeStyleApply
		{
			kDefault,
			kAll
		}
	}
}
